<?php
class Plan extends MY_Controller{
    public function __construct() {
        parent::__construct();
		$this->load->model('model_plan');
    }
	public function index(){
		$id = $this->uri->segment(2);
		$data['trains'] = $this->listtrains(30);
		$data['result'] = $this->model_plan->getdata($id);
		//$this->debug($data['result']);
		if($data['result'] == NULL){
			redirect(base_url());
		}
		$data['title'] = $data['result']['title'];
		$this->load->view("plantrip/layout",$data);
	}
}